<?php
declare (strict_types = 1);

namespace app\common\validate;

use think\Validate;
class TrandingbankAllowplayer extends Validate
{
    protected $rule = ['maxsellnum' => 'require|number',
    ];

    protected $message = [
        'maxsellnum.require' => '允许上架数量为必填项',
        'maxsellnum.number' => '允许上架数量需为数字',
        'allowstatus.number' => '选择状态！！',
        'actorid.unique' => '该账号已存在',
    ];

    /**
     * 添加
     */
    public function sceneAdd()
    {
        return $this->only(['actorid',])
        ->append('allowstatus', 'unique:trandingbank_allowplayer')
        ->append('actorid', 'unique:trandingbank_allowplayer');
    }

    /**
     * 编辑
     */
    public function sceneEdit()
    {
        return $this->only(['maxsellnum',]);
    }
}
